gdkdisplay-x11: Don't do extra work when simply moving the window
authorJasper St. Pierre <jstpierre@mecheye.net>
Thu, 27 Nov 2014 01:07:56 +0000 (17:07 -0800)
committerJasper St. Pierre <jstpierre@mecheye.net>
Thu, 27 Nov 2014 01:14:53 +0000 (17:14 -0800)
We shouldn't bother recalculating all the visible regions and wiping
away the old updating areas if we're simply dragging the window around.

gdk/x11/gdkdisplay-x11.c

index d6543c1e384a9fdb6b83577223839583642ffea6..89c2b7df746d49e4ec7af47e6be91da0401ad0df 100644 (file)
@@ -828,13 +828,18 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
            {
              window->x = event->configure.x;
              window->y = event->configure.y;
-              window_impl->unscaled_width = xevent->xconfigure.width;
-              window_impl->unscaled_height = xevent->xconfigure.height;
-              window->width = event->configure.width;
-              window->height = event->configure.height;
 
-             _gdk_window_update_size (window);
-             _gdk_x11_window_update_size (window_impl);
+              if (window_impl->unscaled_width != xevent->xconfigure.width ||
+                  window_impl->unscaled_height != xevent->xconfigure.height)
+                {
+                  window_impl->unscaled_width = xevent->xconfigure.width;
+                  window_impl->unscaled_height = xevent->xconfigure.height;
+                  window->width = event->configure.width;
+                  window->height = event->configure.height;
+
+                  _gdk_window_update_size (window);
+                  _gdk_x11_window_update_size (window_impl);
+                }
 
              if (window->resize_count >= 1)
                {